import {
  Component, OnInit, ViewEncapsulation, Input, Output,
  EventEmitter
} from '@angular/core';


@Component({
  selector: 'seed-grid-nav',
  templateUrl: './grid-nav.component.html',
  styleUrls: ['./grid-nav.component.scss'],
  encapsulation: ViewEncapsulation.None
})
export class GridNavComponent implements OnInit {
  @Input() navList;
  @Output() clicked: EventEmitter<any> = new EventEmitter<any>();
  constructor(
  ) { }

  /**
   * @description 前往目标页面
   * @author ouyqx-691
   * @date 2017/11/21
   * @param navItem 单个 nav 对象
   */
  goToTargetPage(navItem) {
    this.clicked.emit(navItem); // 选择 nav 后抛出一个事件
  }

  ngOnInit() {
  }

}
